package framework.apache.poi.docx;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;

import org.apache.poi.openxml4j.opc.OPCPackage;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
import org.apache.poi.xwpf.usermodel.XWPFRun;
public class testDocx {
	/**
	 * @param args
	 * @throws Exception
	 */
	public static void main(String[] args) throws Exception {
		String filename1 = "docx1.docx";
		String filename2 = "docx2.docx";
		File file1 = new File(filename1);
		File file2 = new File(filename2);
		FileInputStream fis = new FileInputStream(file1);
		FileOutputStream fos = new FileOutputStream(file2);
		OPCPackage pack = OPCPackage.open(fis);
		XWPFDocument doc = new XWPFDocument(pack);
		// XWPFDocument doc = new XWPFDocument(fis);
		XWPFParagraph p1 = doc.getParagraphArray(0);
		fos.flush();
		pack.close();
		fos.close();
	}
}
